﻿using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;

namespace Puppy.ActorDb.Query
{
    /// <summary>
    /// Actor 的 <see cref="IQueryProvider"/> 实现
    /// </summary>
    public interface IActorQueryProvider : IQueryProvider
    {
        /// <summary>
        /// 执行由指定表达式树表示的强类型查询
        /// </summary>
        /// <typeparam name="TResult">返回结果的类型</typeparam>
        /// <param name="expression">表示LINQ查询的表达式树</param>
        /// <param name="cancellationToken">取消Token</param>
        /// <returns>执行指定查询后产生的值</returns>
        Task<TResult> ExecuteAsync<TResult>(Expression expression, CancellationToken cancellationToken = default);
    }
}
